import { http } from '@/utils/http/axios';
import { RequestEnum } from "@/enums/httpEnum";

/**
 * 获取在线用户列表
 */
export const getOnlineUser = (params: { username?: string }) => {
  return http.request({
    url: `/online/list`,
    method: RequestEnum.GET,
    params
  })
}

/**
 * 强制下线用户
 * @param username
 * @param uid
 */
export const offlineUser = ({ username, uid }) => {
  return http.request({
    url: `/online/offline/${username}/${uid}`,
    method: RequestEnum.DELETE
  }, {
    isShowSuccessMessage: true
  })
}
